using System;
using System.Web.UI.WebControls;

using SBPweb.Data;

namespace SBPweb.Controls.Web
{
	public delegate void EntityGridViewDeleteEventHandler(object sender, EntityGridViewDeleteEventArgs e);

	public class EntityGridViewDeleteEventArgs : GridViewDeleteEventArgs
	{

		#region Private fields

		private Entity mEntity;
		private int mIndex;

		#endregion

		#region Constructor logic

		internal EntityGridViewDeleteEventArgs(int rowIndex, Entity entity)
			: base(rowIndex)
		{
			mIndex = rowIndex;
			mEntity = entity;
		}

		internal EntityGridViewDeleteEventArgs(GridViewDeleteEventArgs originalArgs, Entity entity)
			: base(originalArgs.RowIndex)
		{
			mIndex = originalArgs.RowIndex;
			mEntity = entity;
		}

		#endregion

		#region Public property accessors

		public Entity RowEntity
		{
			get
			{
				return mEntity;
			}
			protected internal set
			{
				mEntity = value;
			}
		}

		public new int RowIndex
		{
			get
			{
				return mIndex;
			}
			protected internal set
			{
				mIndex = value;
			}
		}

		#endregion

	}
}
